<extend name="layout:index"/>
<block name="style">
	<style>
		td{
			font-size:10px;
		}
		th{
			font-size:10px;
		}
		.grid_4{
			display:none;
		}
	</style>
</block>
<block name="content">
<div class="mws-panel grid_8" style="min-width:925px">
	<div class="mws-panel-header">
		<span><i class="icon-table"></i>管理中心-会员列表</span>
	</div>
	<div class="mws-panel-body no-padding">
		<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
			<form action="/admin/user/index" method="get">
				<div id="DataTables_Table_1_length" class="dataTables_length">
					<label>显示 
					<select size="1" name="num" aria-controls="DataTables_Table_1">
						<option value="10" <if condition="$num eq 10">selected</if>>10</option>
						<option value="25" <if condition="$num eq 25">selected</if>>25</option>
						<option value="50" <if condition="$num eq 50">selected</if>>50</option>
						<option value="100" <if condition="$num eq 100">selected</if>>100</option>
					</select> 页
				</label>
				</div>
					<div class="dataTables_filter" id="DataTables_Table_1_filter"><label>搜索用户名: <input aria-controls="DataTables_Table_1" name="username" type="text"></label>
					<label>搜索ID: <input aria-controls="DataTables_Table_1" name="userid" type="text"></label>
					<label>搜索真实姓名: <input aria-controls="DataTables_Table_1" name="truename" type="text"></label>
					<label> VIP等级 
						<select size="1" name="user_type" aria-controls="DataTables_Table_1">
							<option value="">搜索等级</option>
							<option value="3" <if condition="$user_type eq 3">selected</if>>VIP1</option>
							<option value="5" <if condition="$user_type eq 5">selected</if>>VIP2</option>
							<option value="10" <if condition="$user_type eq 10">selected</if>>VIP3</option>
							<option value="30" <if condition="$user_type eq 30">selected</if>>VIP4</option>
							<option value="50" <if condition="$user_type eq 50">selected</if>>VIP5</option>
							<option value="100" <if condition="$user_type eq 100">selected</if>>VIP6</option>
						</select>
					</label>
					<input type="submit" value="提交" class="btn btn-primary">
				</div>
			</form>			
			<table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info" >
			    <thead>
			        <tr role="row" >
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" width="30px" >中心
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="Browser: activate to sort column ascending" >ID号
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="Platform(s): activate to sort column ascending">用户名
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="Engine version: activate to sort column ascending">等级
				        </th>
				       
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">姓名
				        </th>
				      
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending" >积分
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">奖励
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">E积分
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">小区业绩
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">出局
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending">注册时间
				        </th>
				        <th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1"  aria-label="CSS grade: activate to sort column ascending" width="30px">操作
				        </th>
			        </tr>
			    </thead>
				<tbody role="alert" aria-live="polite" aria-relevant="all">
				<volist name='res' id="vo">
					<tr class="odd">
			            <td class="">
			            	<if condition="$vo.is_reportcenter eq true">
			            		<img class="baodan" name="{$vo.is_reportcenter}" src="__PUBLIC__/yes.gif" alt="">
			            	<else/>
			            		<img class="baodan" name="{$vo.is_reportcenter}" src="__PUBLIC__/no.gif" alt="">
			            	</if>
			            </td>
			            <td class="">{$vo.user_id}</td>
			            <td class="">{$vo.user_name}</td>
			            <td class="">{$vo.name}</td>
			          
			            <td class="">{$vo.true_name}</td>
			            <td class=" ">
			            	现金积分：{$vo.user_money1}<br>
			            	注册积分：{$vo.user_money2}<br>
			            	认购积分：{$vo.user_money3}<br>
			            	商城积分：{$vo.user_money4}<br>
			            	上市股权：{$vo.user_money}<br>
			            	慈善积分：{$vo.cishan_money}<br>
			            	动态扣税：{$vo.dongtaikoushui_money}
			            </td>
			            <td class=" ">
			            	销售奖：{$vo.pay_points1}<br>
			            	平衡奖：{$vo.pay_points2}<br>
			            	管理奖：{$vo.pay_points3}<br>
			            	交易奖：{$vo.pay_points4}<br>
							服务奖：{$vo.pay_points5}
			            </td>
			            <td class=" ">{$vo.option_num}</td>
			            
			            <td class=" ">{$vo.left_num}</td>
			            
			            <td class=" ">
			            	<if condition="$vo.is_out eq true">
			            		<img src="__PUBLIC__/yes.gif" alt="">
			            	<else/>
			            		<img src="__PUBLIC__/no.gif" alt="">
			            	</if>
			            </td>
			            <td class=" ">{:date('Y-m-d H:i:s',$vo['reg_time'])}</td>
			            <td>
			            	<a href="/admin/user/chakan?aa={$vo.user_id}&bb={$vo.inviter_id}&cc={$vo.tree_id}&dd={$vo.report_user_id}" title="查看"><font class="caozuo" style="color:#000">查看</font></a>
			            	<a href="__APP__/home/login/dologin/ad_us_id/{$vo.user_id}" title="前台" target="_blank"><font class="caozuo" style="color:#000">前台</font></a>
			            	<a href="/admin/user/bianji?aa={$vo.user_id}" title="编辑"><font class="caozuo" style="color:#000">编辑</font></a>
			            	<a href="/admin/user/mingxi?aa={$vo.user_id}&bb={$vo.user_name}" title="明细"><font class="caozuo" style="color:#000">明细</font></a>
			            	<if condition="$vo.is_jh eq 0">
			            		<a href="__MODULE__/user/dongjie?aa={$vo.user_id}" title="冻结"><font class="caozuo" style="color:#000">冻结</font></a>
			            	<else/>
			            		<a href="__MODULE__/user/jiedong?aa={$vo.user_id}" title="取消冻结"><font class="caozuo" style="color:#000">取消冻结</font></a>
			            	</if>
			            </td>
			        </tr>
			    </volist>
				</tbody>
			</table>
			<div class="dataTables_info" id="DataTables_Table_1_info">总计:{$count}</div>
			<div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate">
				{$url}
			</div>
		</div>
    </div>
</div>

<script>
 	$.ajaxSetup({
         headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
         }
    });
	$('.caozuo').mouseover(function(){
		$(this).css('cursor','pointer');
		$(this).css('color','red');
	}).mouseout(function(){
		$(this).css('color','#000')
	});

	$('.baodan').click(function(){
		var baodan_id = $(this).parent().next().text();
		var baodan = $(this).attr('name');
		var i = $(this).parent().parent().index();
		$.ajax({
		   type: "POST",
		   url: "/admin/user/baodan",
		   data: {user_id:baodan_id,is_reportcenter:baodan},
		   async: false,
		   success: function(str){
		     if(str == 1){
		     	if(baodan == 1){
		     		$('.baodan').eq(i).attr('src','__PUBLIC__/no.gif');
		     		$('.baodan').eq(i).attr('name',0);
		     		alert('切换成功');
		     	}else{
		     		$('.baodan').eq(i).attr('src','__PUBLIC__/yes.gif');
		     		$('.baodan').eq(i).attr('name',1);
		     		alert('切换成功');
		     	}
		     }else{
		     	alert('切换失败');
		     }
		   }
		});
	});
</script>
</block>